<?php
    // +----------------------------------------------------------------------
    // | 用户私信聊天记录
    // +----------------------------------------------------------------------
    // | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
    // +----------------------------------------------------------------------
    // | Author: 微尘 <yicmf@qq.com>
    // +----------------------------------------------------------------------
    namespace app\model\pay;

    use app\model\app\Device;
    use app\model\file\Image;
    use app\model\pos\Common;
    use app\model\ucenter\IpPool;
	use app\model\ucenter\User;
    use app\event\im\Chat as ChatEvent;
    use think\model\concern\SoftDelete;
    use yicmf\tools\FlowSn;

    class PointOrder extends Common
    {
        use SoftDelete;

        public function user()
        {
            return $this->belongsTo(User::class);
        }

        public function image()
        {
            return $this->belongsTo(Image::class)->field('id,name,save_name,driver,url,path');
        }



        /**
         * 写入修改
         * @param $data
         */
        public static function onBeforeInsert($data)
        {
            $data['status'] = 1;
            $data['sn'] = FlowSn::build('PT');
        }
        protected $type = [
            'info'=>'array'
        ];
    }
